﻿<?php
require_once(dirname(__FILE__)."/../../libs/login/login.php");  
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../admin/libs/shuxing_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();
$sx=new shuxing();
$id=$_GET["id"];
if(!$mc->isnum($id)){
$mc->msg("参数错误！");	
}

$allsx=$sx->getshuxingtype();
$tb=$allsx[0]["ziduan"]."_class";//默认第一个属性
$_sx=$allsx[0]["ziduan"];
if($mc->Ismp($_GET["sx"])!=""){
$tb=$_GET["sx"]."_class";	
$_sx=$_GET["sx"];
}

$mydata=$sx->getshuxingshow($tb,$id);

if ($mc->Ismp($_POST["Submit"])!="")
{
	if ($_POST["classname"]==""){$mc->msg("类别不能为空","go");}
	$classname=$_POST["classname"];
	$content=$_POST["content"];
	 $classorder=$_POST["classorder"];
$sx->updateshuxing($tb,$id,$classname,$content,$classorder);
$mc->msg("修改成功","shuxing_class.php?id=".$id."&sx=".$_GET["sx"]."");

}
$path="编辑产品属性";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
<form name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="100%" height="24" class="top_head">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="1%" align="right"  height="45">&nbsp;</td>
                    <td width="99%" >
                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="55%" style="padding-left:20px;padding-top:10px;"><img src="../images/head.gif" width="13" height="11"><b><?php echo $path;?></b><a href="shuxing_class.php" style=" margin-left:20px; text-decoration:underline;">返回列表</a></td>
                        <td width="45%" align="right">&nbsp;</td>
                      </tr>
                    </table>
                    </td>
                  </tr>
                </table>
            </td>
          </tr>
   </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liebiao">
  
  
  <tr>
    <td width="11%" height="50" align="right">类别名称：</td>
    <td height="50"><input name="classname" type="text" id="classname" value="<?php echo $mydata['classname'];?>" ><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">类别排列：</td>
    <td height="50" valign="middle"><input name="classorder" type="text" id="classorder" value="<?php echo $mydata['classorder'];?>" ><Font>
   (必须为数字)</Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">备注说明：</td>
    <td height="50" valign="middle"><textarea name="content" id="content" cols="30"  rows="2"><?php echo $mydata["content"];?></textarea>
      <Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">&nbsp;</td>
    <td height="50" valign="middle"><bdo>
      <input type="submit" name="Submit" value="提交"> <input type="button" name="button" value="返回" onClick="location.href='shuxing_class.php?sx=<?php echo $_GET["sx"];?>'">
    </bdo></td>
    </tr>
    </table>
</form>
</div>
</div>
</body>
</html>
